local extension = Package("rfenghou_qun")
extension.extensionName = "aaa_fenghou"

local U = require "packages/utility/utility"
local RUtil = require "packages/aaa_fenghou/utility/rfenghou_util"
local DIY = require "packages/diy_utility/diy_utility"

Fk:loadTranslationTable{
  ["rfenghou_qun"] = "出群",
}

local function AddWinAudio(general)
  local Win = fk.CreateActiveSkill{ name = general.name.."_win_audio" }
  Win.package = extension
  Fk:addSkill(Win)
end

local nuerhachi = General:new(extension, "rfenghou__nuerhachi", "qun", 4)
local chiguo = fk.CreateTriggerSkill{
  name = "rfenghou__chiguo",
  frequency = Skill.Compulsory,
  events = {fk.CardUseFinished, fk.BuryVictim},
  can_trigger = function(self, event, target, player, data)
    if player:hasSkill(self) then
      if event == fk.CardUseFinished then
        return target == player and data.card.trueName == "slash"
      elseif event == fk.BuryVictim then
        return data.damage and data.damage.from and data.damage.from == player and not player.room:getTag(self.name)
      end
    end
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    if event == fk.CardUseFinished then
      room:addPlayerMark(player, self.name, 1)
    elseif event == fk.BuryVictim then
      room:setTag("SkipNormalDeathProcess", true)
      room:setTag(self.name, true)
      player:setCardUseHistory("slash", 0, Player.HistoryGame)
      room:setPlayerMark(player, "@rfenghou__chiguo", 3)
    end
  end,

  refresh_events = {fk.GameStart, fk.EventAcquireSkill, fk.AfterCardUseDeclared, fk.DrawNCards, fk.Deathed},
  can_refresh = function (self, event, target, player, data)
    if event == fk.GameStart then
      return player:hasSkill(self, true)
    elseif event == fk.EventAcquireSkill then
      return target == player and data == self
    elseif event == fk.AfterCardUseDeclared then
      return target == player and player:hasSkill(self, true) --本身只是提示作用，就不限牌名了
    elseif event == fk.DrawNCards then
      return target == player and player:getMark(self.name) ~= 0
    elseif event == fk.Deathed then
      return player.room:getTag(self.name)
    end
  end,
  on_refresh = function (self, event, target, player, data)
    local room = player.room
    if event == fk.GameStart then
      room:setPlayerMark(player, "@rfenghou__chiguo", 3)
    elseif event == fk.EventAcquireSkill or event == fk.AfterCardUseDeclared then
      local n = 3 - player:usedCardTimes("slash", Player.HistoryGame)
      if n >= 0 then
        room:setPlayerMark(player, "@rfenghou__chiguo", n)
      else
        room:setPlayerMark(player, "@rfenghou__chiguo", 0)
      end
    elseif event == fk.DrawNCards then
      data.n = data.n + player:getMark(self.name)
    elseif event == fk.Deathed then
      room:setTag("SkipNormalDeathProcess", false)
      room:setTag(self.name, false)
    end
  end,
}
local chiguo_prohibit = fk.CreateProhibitSkill{
  name = "#rfenghou__chiguo_prohibit",
  prohibit_use = function(self, player, card)
    return player:hasSkill(chiguo) and card and card.trueName == "slash" and player:usedCardTimes("slash", Player.HistoryGame) > 2
  end
}
local jiezhu_active = fk.CreateActiveSkill{
  name = "rfenghou__jiezhu_active",
  card_num = 1,
  min_target_num = 0,
  max_target_num = 1,
  interaction = function()
    return UI.ComboBox {choices = {"rfenghou__jiezhu1", "rfenghou__jiezhu2"}}
  end,
  card_filter = function(self, to_select, selected)
    if #selected == 0 and not Self:prohibitDiscard(to_select) then
      if self.interaction.data == "rfenghou__jiezhu1" then
        return Fk:getCardById(to_select).sub_type == Card.SubtypeOffensiveRide
      else
        return Fk:getCardById(to_select).sub_type == Card.SubtypeWeapon
      end
    end
  end,
  target_filter = function (self, to_select, selected)
    if self.interaction.data == "rfenghou__jiezhu1" then
      return false
    else
      return #selected == 0 and to_select ~= Self.id
    end
  end,
  feasible = function (self, selected, selected_cards)
    if #selected_cards == 1 then
      if self.interaction.data == "rfenghou__jiezhu1" then
        return #selected == 0
      else
        return #selected == 1
      end
    end
  end,
}
local jiezhu = fk.CreateTriggerSkill{
  name = "rfenghou__jiezhu",
  events = {fk.EventPhaseStart},
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(self) and player.phase == Player.Finish and not player:isNude()
  end,
  on_cost = function (self, event, target, player, data)
    local success, dat = player.room:askForUseActiveSkill(player, "rfenghou__jiezhu_active",
      "#rfenghou__jiezhu-choice", true, nil, false)
    if success and dat then
      self.cost_data = {cards = dat.cards, tos = dat.targets, choice = dat.interaction}
      return true
    end
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    room:throwCard(self.cost_data.cards, self.name, player, player)
    if self.cost_data.choice == "rfenghou__jiezhu1" then
      if player.dead then return end
      player:gainAnExtraTurn(true, self.name)
    else
      local to = room:getPlayerById(self.cost_data.tos[1])
      if not to.dead then
        to:turnOver()
      end
    end
  end
}
Fk:addSkill(jiezhu_active)
chiguo:addRelatedSkill(chiguo_prohibit)
nuerhachi:addSkill(chiguo)
nuerhachi:addSkill(jiezhu)
Fk:loadTranslationTable{
  ["rfenghou__nuerhachi"] = "努尔哈赤",
  ["#rfenghou__nuerhachi"] = "罪日拓咎",
  ["designer:rfenghou__nuerhachi"] = "猪",

  ["rfenghou__chiguo"] = "笞国",
  [":rfenghou__chiguo"] = "锁定技，每局游戏你至多使用三张【杀】；当你使用【杀】结算后，你摸牌阶段摸牌数+1；你执行的击杀奖惩改为重置使用"..
  "【杀】次数。",
  ["rfenghou__jiezhu"] = "皆逐",
  [":rfenghou__jiezhu"] = "结束阶段，你可以选择一项：1.弃置一张进攻坐骑牌，获得一个额外回合；2.弃置一张武器牌，令一名其他角色翻面。",
  ["@rfenghou__chiguo"] = "笞国",
  ["#rfenghou__jiezhu-choice"] = "皆逐：你可以弃置一张牌，执行对应效果",
  ["rfenghou__jiezhu_active"] = "皆逐",
  ["rfenghou__jiezhu1"] = "弃置进攻坐骑，获得额外回合",
  ["rfenghou__jiezhu2"] = "弃置武器牌，令一名角色翻面",
}



local huangtaiji = General:new(extension, "rfenghou__huangtaiji", "qun", 4)
local gulve = fk.CreateActiveSkill{
  name = "rfenghou__gulve",
  prompt = "#rfenghou__gulve",
  card_num = function ()
    if Self:getHandcardNum() > 3 then
      return Self:getHandcardNum() - 3
    else
      return 0
    end
  end,
  target_num = 0,
  can_use = function(self, player)
    return player:usedSkillTimes(self.name, Player.HistoryPhase) == 0 and player:getHandcardNum() ~= 3
  end,
  card_filter = function(self, to_select, selected)
    if Self:getHandcardNum() > 3 then
      return #selected < Self:getHandcardNum() - 3 and table.contains(Self:getCardIds("h"), to_select) and
        not Self:prohibitDiscard(to_select)
    else
      return false
    end
  end,
  on_use = function(self, room, effect)
    local player = room:getPlayerById(effect.from)
    if #effect.cards == 0 then
      player:drawCards(3 - player:getHandcardNum(), self.name)
    else
      room:throwCard(effect.cards, self.name, player, player)
      if player.dead or player:isKongcheng() or #room.discard_pile == 0 then return end
      local cards = room:askForPoxi(player, "rfenghou__gulve_exchange", {
        { "pile_discard", room.discard_pile },
        { player.general, player:getCardIds("h") },
      }, {num = #effect.cards}, true)
      if #cards == 0 then return end
      local cards1 = table.filter(cards, function (id)
        return table.contains(player:getCardIds("h"), id)
      end)
      local cards2 = table.filter(cards, function (id)
        return table.contains(room.discard_pile, id)
      end)
      U.swapCardsWithPile(player, cards1, cards2, self.name, "discardPile", true, player.id)
    end
  end
}
Fk:addPoxiMethod{
  name = "rfenghou__gulve_exchange",
  prompt = function (data, extra_data)
    return "#rfenghou__gulve_exchange:::"..math.floor(extra_data.num)
  end,
  card_filter = function(to_select, selected, data, extra_data)
    return #selected < 2 * extra_data.num
  end,
  feasible = function(selected, data, extra_data)
    if #selected > 0 and #selected % 2 == 0 then
      local dat1, dat2 = {0, 0, 0}, {0, 0, 0}
      for _, id in ipairs(selected) do
        local card = Fk:getCardById(id)
        if table.contains(data[1][2], id) then
          dat1[card.type] = dat1[card.type] + 1
        else
          dat2[card.type] = dat2[card.type] + 1
        end
      end
      return table.every({1, 2, 3}, function (index)
        return dat1[index] == dat2[index]
      end)
    end
  end,
}
local lanqi = fk.CreateTriggerSkill{
  name = "rfenghou__lanqi",
  events = {fk.BeforeDrawCard},
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(self) and
      table.find(player.room.alive_players, function (p)
        if not table.contains(player:getTableMark(self.name), p.id) then
          if p == player then
            return #player:getCardIds("ej") >= data.num
          else
            return #p:getCardIds("hej") >= data.num
          end
        end
      end)
  end,
  on_cost = function (self, event, target, player, data)
    local room = player.room
    local targets = table.filter(room.alive_players, function (p)
      if not table.contains(player:getTableMark(self.name), p.id) then
        if p == player then
          return #player:getCardIds("ej") >= data.num
        else
          return #p:getCardIds("hej") >= data.num
        end
      end
    end)
    local to = room:askForChoosePlayers(player, table.map(targets, Util.IdMapper), 1, 1,
      "#rfenghou__lanqi-choose:::"..data.num, self.name, true, false)
    if #to > 0 then
      self.cost_data = {tos = to}
      return true
    end
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    local to = room:getPlayerById(self.cost_data.tos[1])
    local flag = "hej"
    if to == player then
      flag = "ej"
    end
    local cards = room:askForCardsChosen(player, to, data.num, data.num, "hej", flag, "#rfenghou__lanqi-prey::"..to.id..":"..data.num)
    room:moveCardTo(cards, Card.PlayerHand, player, fk.ReasonPrey, self.name, nil, false, player.id)
    if player.dead or to.dead then return end
    if room:askForSkillInvoke(to, self.name, nil, "#rfenghou__lanqi-invoke:"..player.id.."::"..#cards) then
      to:drawCards(#cards, self.name)
    else
      room:addTableMark(player, self.name, to.id)
    end
    return true
  end
}
huangtaiji:addSkill(gulve)
huangtaiji:addSkill(lanqi)
Fk:loadTranslationTable{
  ["rfenghou__huangtaiji"] = "皇太极",
  ["#rfenghou__huangtaiji"] = "莽天腾苍",
  ["designer:rfenghou__huangtaiji"] = "zzcclll朱苦力",
  ["illustrator:rfenghou__huangtaiji"] = "珊瑚虫",

  ["rfenghou__gulve"] = "固略",
  [":rfenghou__gulve"] = "出牌阶段限一次，你可以将手牌调整至三张，每因此弃置一张牌，你便可用一张手牌替换弃牌堆中一张相同类别的牌。",
  ["rfenghou__lanqi"] = "揽气",
  [":rfenghou__lanqi"] = "每名角色限一次，当你摸牌时，你可以改为获得一名角色区域内等量张牌，然后其可以摸等量牌令此技能视为未对其发动过。",
  ["#rfenghou__gulve"] = "固略：将手牌调整至三张，每弃置一张牌便可以用一张手牌交换弃牌堆中的同类别牌",
  ["rfenghou__gulve_exchange"] = "固略",
  ["#rfenghou__gulve_exchange"] = "固略：用手牌与弃牌堆同类别交换，至多%arg张",
  ["#rfenghou__lanqi-choose"] = "揽气：你即将摸%arg张牌，是否改为获得一名角色区域内等量的牌？",
  ["#rfenghou__lanqi-prey"] = "揽气：获得 %dest 区域内%arg张牌",
  ["#rfenghou__lanqi-invoke"] = "揽气：你可以摸%arg张牌，或点“取消”令 %src 不能再对你发动“揽气”",
}


local xiaofeng = General:new(extension, "rfenghou__xiaofeng", "qun", 4)
local feichou = fk.CreateActiveSkill{
  name = "rfenghou__feichou",
  anim_type = "offensive",
  interaction = function(self)
    if Self:usedSkillTimes("rfenghou__feichou", Player.HistoryPhase) == 0 then return end
    return UI.ComboBox { choices = {"slash", "peach"} }
  end,
  prompt = function (self)
    if Self:usedSkillTimes("rfenghou__feichou", Player.HistoryPhase) == 0 then
      return "#rfenghou__feichou-fire_attack"
    else
      local colors = Self:getTableMark("@rfenghou__feichou-phase")
      if #colors == 0 then return " " end
      return "#rfenghou__feichou-use:::"..table.concat(colors, ",")
    end
  end,
  can_use = function(self, player)
    if player:usedSkillTimes(self.name, player.HistoryPhase) == 0 then
      return table.find(Fk:currentRoom().alive_players, function (p)
        return player:canUseTo(Fk:cloneCard("fire_attack"), p)
      end)
    else
      return player:getMark("@rfenghou__feichou-phase") ~= 0
    end
  end,
  card_num = function ()
    if Self:usedSkillTimes("rfenghou__feichou", Player.HistoryPhase) == 0 then
      return 0
    else
      return 1
    end
  end,
  target_num = function ()
    if Self:usedSkillTimes("rfenghou__feichou", Player.HistoryPhase) == 0 then
      return 0
    else
      return 1
    end
  end,
  card_filter = function(self, to_select, selected)
    if Self:usedSkillTimes("rfenghou__feichou", Player.HistoryPhase) == 0 then
      return false
    else
      return #selected == 0 and
        table.contains(Self:getTableMark("@rfenghou__feichou-phase"), Fk:getCardById(to_select):getColorString())
    end
  end,
  target_filter = function(self, to_select, selected, selected_cards)
    if Self:usedSkillTimes("rfenghou__feichou", Player.HistoryPhase) == 0 then
      return false
    elseif #selected == 0 and #selected_cards == 1 then
      local target = Fk:currentRoom():getPlayerById(to_select)
      local name = self.interaction.data
      if not name then return false end
      local card = Fk:cloneCard(name)
      card.skillName = self.name
      card:addSubcard(selected_cards[1])
      if not Self:isProhibited(target, card) and not Self:prohibitUse(card) then
        if name == "slash" then
          return Self:canUse(card)
        else
          return target:isWounded()
        end
      end
    end
  end,
  on_use = function(self, room, effect)
    local player = room:getPlayerById(effect.from)
    if #effect.cards == 0 then
      local targets = table.filter(room:getAlivePlayers(), function (p)
        return player:canUseTo(Fk:cloneCard("fire_attack"), p)
      end)
      room:useVirtualCard("fire_attack", nil, player, targets, self.name)
    else
      room:useVirtualCard(self.interaction.data, effect.cards, player, room:getPlayerById(effect.tos[1]), self.name)
    end
  end
}
--[[
local feichou__fireAttackSkill = fk.CreateActiveSkill{
  name = "feichou__fire_attack_skill",
  prompt = "#fire_attack_skill",
  target_num = 1,
  mod_target_filter = function(self, to_select, selected, user, card, distance_limited)
    return not Fk:currentRoom():getPlayerById(to_select):isKongcheng()
  end,
  target_filter = function(self, to_select, selected, selected_cards, card)
    if #selected < self:getMaxTargetNum(Self, card) then
      return self:modTargetFilter(to_select, selected, Self, card)
    end
  end,
  on_effect = function(self, room, cardEffectEvent)
    local from = room:getPlayerById(cardEffectEvent.from)
    local to = room:getPlayerById(cardEffectEvent.to)
    if to:isKongcheng() then return end

    local showCard = room:askForCard(to, 1, 1, false, "fire_attack_skill", false, ".|.|.|hand", "#fire_attack-show:" .. from.id)[1]
    to:showCards(showCard)

    if from.dead then return end

    local cancelable = true
    if #room.logic:getEventsOfScope(GameEvent.Death, 1, function (e)
      local deathData = e.data[1]
      return deathData.damage and deathData.damage.from == to
    end, Player.HistoryGame) > 0 then
      cancelable = false
    end
    showCard = Fk:getCardById(showCard)
    local prompt = "#fire_attack-discard:"..to.id.."::"..showCard:getSuitString(true)
    if not cancelable then
      prompt = "#rfenghou__feichou-discard:"..to.id.."::"..showCard:getSuitString(true)
    end
    local cards = room:askForDiscard(from, 1, 1, false, "fire_attack_skill", true, ".|.|"..showCard:getSuitString(), prompt)
    if not cancelable and #cards == 0 then
      local card = table.filter(from:getCardIds("h"), function (id)
        return Fk:getCardById(id).suit == showCard.suit and not from:prohibitDiscard(id)
      end)
      if #card > 0 then
        cards = table.random(card, 1)
        room:throwCard(cards, "fire_attack_skill", from, from)
      end
    end
    if #cards > 0 then
      if not from.dead then
        room:addTableMark(from, "@rfenghou__feichou-phase", showCard:getColorString())
      end
      room:damage({
        from = from,
        to = to,
        card = cardEffectEvent.card,
        damage = 1,
        damageType = fk.FireDamage,
        skillName = "fire_attack_skill",
      })
    end
  end,
}
feichou__fireAttackSkill.cardSkill = true
Fk:addSkill(feichou__fireAttackSkill)
--]]
local feichou_trigger = fk.CreateTriggerSkill{
  name = "#rfenghou__feichou_trigger",
  refresh_events = {fk.AfterCardsMove},
  can_refresh = function (self, event, target, player, data)
    if not player:hasSkill(feichou) then return false end
    local logic = player.room.logic
    local currentEvent = logic:getCurrentEvent()
    local parent = currentEvent.parent
    if parent and parent.event == GameEvent.SkillEffect then
      parent = parent.parent
      if parent and parent.event == GameEvent.CardEffect then
        local effect = parent.data[1]
        if effect.card and table.contains(effect.card.skillNames, feichou.name) then
          for _, move in ipairs(data) do
            if move.from == player.id and move.moveReason == fk.ReasonDiscard then
              for _, info in ipairs(move.moveInfo) do
                if info.fromArea == Card.PlayerEquip or info.fromArea == Card.PlayerHand then
                  return true
                end
              end
            end
          end
        end
      end
    end
  end,
  on_refresh = function (self, event, target, player, data)
    local colors = {}
    for _, move in ipairs(data) do
      if move.from == player.id and move.moveReason == fk.ReasonDiscard then
        for _, info in ipairs(move.moveInfo) do
          if info.fromArea == Card.PlayerEquip or info.fromArea == Card.PlayerHand then
            player.room:addTableMarkIfNeed(player, "@rfenghou__feichou-phase", Fk:getCardById(info.cardId):getColorString())
          end
        end
      end
    end
  end,
}
feichou:addRelatedSkill(feichou_trigger)
xiaofeng:addSkill(feichou)
Fk:loadTranslationTable{
  ["rfenghou__xiaofeng"] = "萧峰",
  ["designer:rfenghou__xiaofeng"] = "拼音",
  ["#rfenghou__xiaofeng"] = "龙心负矢",

  ["rfenghou__feichou"] = "沸仇",
  [":rfenghou__feichou"] = "出牌阶段限一次，你可以视为对所有角色使用【火攻】。你以此法弃牌后，本阶段空闲时可以将相同颜色的牌当【杀】或【桃】对一名角色使用。",
  ["#rfenghou__feichou-fire_attack"] = "沸仇：你可以视为对所有角色使用一张【火攻】！",
  ["#rfenghou__feichou-use"] = "沸仇：你可以将%arg牌当【杀】或【桃】对一名角色使用",
  ["@rfenghou__feichou-phase"] = "沸仇",
  --["#rfenghou__feichou-discard"] = "%src 杀死过角色，你必须弃置一张%arg手牌对其造成1点火焰伤害！（点“取消”随机弃置一张此花色手牌）",
}


local duanyu = General:new(extension, "rfenghou__duanyu", "qun", 3)
local fangshi = fk.CreateTriggerSkill{
  name = "rfenghou__fangshi",
  anim_type = "drawcard",
  events = {fk.TurnEnd},
  can_trigger = function(self, event, target, player, data)
    if player:hasSkill(self) and not player:isKongcheng() and
      ((target == player and player:getMark("rfenghou__fangshi1-round") == 0) or
      (target ~= player and player:getMark("rfenghou__fangshi2-round") == 0)) then
      local room = player.room
      local id = -1
      room.logic:getEventsByRule(GameEvent.MoveCards, 1, function (e)
        for i = #e.data, 1, -1 do
          local move = e.data[i]
          if move.toArea == Card.DiscardPile then
            if move.from == player.id then
              for j = #move.moveInfo, 1, -1 do
                local info = move.moveInfo[j]
                if info.fromArea == Card.PlayerHand or info.fromArea == Card.PlayerEquip then
                  id = info.cardId
                  return true
                end
              end
            elseif move.from == nil and
              table.contains({fk.ReasonUse, fk.ReasonResonpse, fk.ReasonPutIntoDiscardPile}, move.moveReason) then
              local parent_event = e.parent
              if parent_event ~= nil then
                local card_ids = {}
                if parent_event.event == GameEvent.UseCard or parent_event.event == GameEvent.RespondCard then
                  if parent_event.data[1].from == player.id then
                    parent_event:searchEvents(GameEvent.MoveCards, 1, function(e2)
                      if e2.parent and e2.parent.id == parent_event.id then
                        for _, move2 in ipairs(e2.data) do
                          if (move2.moveReason == fk.ReasonUse or move2.moveReason == fk.ReasonResonpse) then
                            for _, info in ipairs(move2.moveInfo) do
                              if info.fromArea == Card.PlayerHand or info.fromArea == Card.PlayerEquip then
                                table.insertIfNeed(card_ids, info.cardId)
                              end
                            end
                          end
                        end
                        if #card_ids > 0 then
                          return true
                        end
                      end
                    end)
                  end
                elseif parent_event.event == GameEvent.Pindian then
                  local pindian = parent_event.data[1]
                  if pindian.from == player then
                    card_ids = room:getSubcardsByRule(pindian.fromCard)
                  elseif pindian.results[player.id] then
                    card_ids = room:getSubcardsByRule(pindian.results[player.id].toCard)
                  end
                end
                if #card_ids > 0 then
                  for j = #move.moveInfo, 1, -1 do
                    local info = move.moveInfo[j]
                    if table.contains(card_ids, info.cardId) and info.fromArea == Card.Processing then
                      id = info.cardId
                      return true
                    end
                  end
                end
              end
            end
          end
        end
      end, room.logic:getCurrentEvent().id)
      if id ~= -1 and table.contains(room.discard_pile, id) then
        self.cost_data = id
        return true
      end
    end
  end,
  on_cost = function(self, event, target, player, data)
    return player.room:askForSkillInvoke(player, self.name, nil,
      "#rfenghou__fangshi-invoke:::"..Fk:getCardById(self.cost_data):toLogString())
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    if target == player then
      room:setPlayerMark(player, "rfenghou__fangshi1-round", 1)
    else
      room:setPlayerMark(player, "rfenghou__fangshi2-round", 1)
    end
    U.swapCardsWithPile(player, player:getCardIds("h"), {self.cost_data}, self.name, "discardPile", true, player.id)
    if player.dead or #room.discard_pile == 0 then return end
    room:delay(800)
    local all_cards = {}
    room.logic:getEventsOfScope(GameEvent.MoveCards, 1, function (e)
      for _, move in ipairs(e.data) do
        if move.toArea == Card.DiscardPile then
          for _, info in ipairs(move.moveInfo) do
            table.insert(all_cards, info.cardId)
          end
        end
      end
    end, Player.HistoryTurn)
    local cards = {}
    for i = #all_cards, 1, -1 do
      table.insertIfNeed(cards, all_cards[i])
    end
    if #all_cards < 2 then return end
    local card = {}
    local index = table.indexOf(cards, self.cost_data)
    if index == -1 then return end
    local cards1 = table.slice(cards, 1, index)
    cards1 = table.filter(cards1, function (id)
      return table.contains(room.discard_pile, id) and id ~= self.cost_data
    end)
    if #cards1 > 0 then
      card = U.askforChooseCardsAndChoice(player, cards1, {"OK"}, self.name, "#rfenghou__fangshi-prey")
      room:moveCardTo(card, Card.PlayerHand, player, fk.ReasonJustMove, self.name, nil, true, player.id)
    end
    local cards2 = table.slice(cards, index, #cards)
    cards2 = table.filter(cards2, function (id)
      return table.contains(room.discard_pile, id) and id ~= self.cost_data
    end)
    if #cards2 > 0 then
      card = U.askforChooseCardsAndChoice(player, cards2, {"OK"}, self.name, "#rfenghou__fangshi-prey")
      room:moveCardTo(card, Card.PlayerHand, player, fk.ReasonJustMove, self.name, nil, true, player.id)
    end
  end,
}
local zaiyu = fk.CreateTriggerSkill{
  name = "rfenghou__zaiyu",
  anim_type = "control",
  frequency = Skill.Limited,
  events = {fk.CardUsing},
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(self) and data.tos and not data.card.is_damage_card and
      player:usedSkillTimes(self.name, Player.HistoryGame) == 0
  end,
  on_cost = function (self, event, target, player, data)
    return player.room:askForSkillInvoke(player, self.name, nil, "#rfenghou__zaiyu-invoke:::"..data.card:toLogString())
  end,
  on_use = function(self, event, target, player, data)
    data.additionalEffect = (data.additionalEffect or 0) + 2
    player.room:setPlayerMark(player, "@rfenghou__zaiyu",
      table.concat({Fk:translate(data.card:getSuitString(true)), data.card:getNumberStr(), " ", Fk:translate(data.card.name)}))
    player.room:setPlayerMark(player, "rfenghou__zaiyu", {data.card.color, data.card.number, data.card.type, data.card.trueName})
  end,
}
local zaiyu_delay = fk.CreateTriggerSkill{
  name = "#rfenghou__zaiyu_delay",
  anim_type = "drawcard",
  events = {fk.AfterCardsMove},
  can_trigger = function(self, event, target, player, data)
    if player:getMark("rfenghou__zaiyu") ~= 0 and player:usedSkillTimes(self.name, Player.HistoryRound) == 0 then
      local cards = {}
      for _, move in ipairs(data) do
        if move.to == player.id and move.toArea == Card.PlayerHand then
          for _, info in ipairs(move.moveInfo) do
            if table.contains(player:getCardIds("h"), info.cardId) then
              local card = Fk:getCardById(info.cardId)
              if card.color == player:getMark("rfenghou__zaiyu")[1] or
                card.number == player:getMark("rfenghou__zaiyu")[2] or
                card.type == player:getMark("rfenghou__zaiyu")[3] then
                table.insertIfNeed(cards, info.cardId)
              end
            end
          end
        end
      end
      if #cards > 0 then
        self.cost_data = cards
        return true
      end
    end
  end,
  on_cost = function(self, event, target, player, data)
    local card = player.room:askForCard(player, 1, 1, false, "rfenghou__zaiyu", true, tostring(Exppattern{ id = self.cost_data }),
      "#rfenghou__zaiyu_delay-invoke")
    if #card > 0 then
      self.cost_data = {cards = card}
      return true
    end
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    player:broadcastSkillInvoke("rfenghou__zaiyu")
    local card = Fk:getCardById(self.cost_data.cards[1])
    local n = 0
    if card.color == player:getMark("rfenghou__zaiyu")[1] then
      n = n + 1
    end
    if card.number == player:getMark("rfenghou__zaiyu")[2] then
      n = n + 1
    end
    if card.type == player:getMark("rfenghou__zaiyu")[3] then
      n = n + 1
    end
    player:showCards(self.cost_data.cards)
    if player.dead then return end
    player:drawCards(n, "rfenghou__zaiyu")
    if n == 3 and card.trueName ~= player:getMark("rfenghou__zaiyu")[4] then
      room:setPlayerMark(player, "@rfenghou__zaiyu", 0)
      room:setPlayerMark(player, "rfenghou__zaiyu", 0)
      if player:isWounded() then
        room:recover({
          who = player,
          num = player.maxHp - player.hp,
          skillName = "rfenghou__zaiyu",
        })
      end
      room:handleAddLoseSkills(player, "-rfenghou__zaiyu")
    end
  end,
}
zaiyu:addRelatedSkill(zaiyu_delay)
duanyu:addSkill(fangshi)
duanyu:addSkill(zaiyu)

AddWinAudio(duanyu)
Fk:loadTranslationTable{
  ["rfenghou__duanyu"] = "段誉",
  ["#rfenghou__duanyu"] = "终定猿心",
  ["illustrator:rfenghou__duanyu"] = "珊瑚虫",
  ["designer:rfenghou__duanyu"] = "拼音",
  ["cv:rfenghou__duanyu"] = "胖即是胖",

  ["rfenghou__fangshi"] = "芳识",
  [":rfenghou__fangshi"] = "每轮你的回合内外各限一次，一名角色回合结束时，你可以用所有手牌交换你此回合最后进入弃牌堆的牌，然后获得此回合在"..
  "之前与之后进入弃牌堆的牌各一张。",
  ["rfenghou__zaiyu"] = "再遇",
  [":rfenghou__zaiyu"] = "限定技，当你使用非伤害牌时，你可以令此牌结算三次。每轮限一次，当你获得颜色/类别/点数与之相同的牌后，"..
  "你可展示之并摸满足项数张牌，若为三项但牌名不同，你回复所有体力并失去此技能。",
  ["#rfenghou__fangshi-invoke"] = "芳识：是否用所有手牌交换%arg？",
  ["#rfenghou__fangshi-prey"] = "芳识：获得其中一张牌",
  ["#rfenghou__zaiyu-invoke"] = "再遇：是否令%arg结算三次？",
  ["@rfenghou__zaiyu"] = "再遇",
  ["#rfenghou__zaiyu_delay"] = "再遇",
  ["#rfenghou__zaiyu_delay-invoke"] = "再遇：你可以展示其中一张与“再遇”有相同信息的牌并摸牌",

  ["$rfenghou__fangshi1"] = "庄子这话，拿来形容神仙姐姐，再也贴切不过……",
  ["$rfenghou__fangshi2"] = "倘得长卧小舟，以此女为伴，此生更无他求。",
  ["$rfenghou__zaiyu1"] = "姑娘如此待我，休说西夏公主，便是宋辽吐蕃公主一起，却又如何？",
  ["$rfenghou__zaiyu2"] = "我能见姑娘言笑晏晏，心下欢喜，便是极大的好处。",
  ["~rfenghou__duanyu"] = "葬身这湖畔花下，倒也风雅的紧。",
  ["$rfenghou__duanyu_win_audio"] = "向来痴，从此醉，有情皆孽，何人无恨？",
}


--FY011 袁谭袁尚袁熙 by熊猫
local yuantanyuanshangyuanxi = General:new(extension, "rfenghou__yuantanyuanshangyuanxi", "qun", 4)
local cuoyi = fk.CreateTriggerSkill{
  name = "rfenghou__cuoyi",
  anim_type = "switch",
  frequency = Skill.Compulsory,
  events = {fk.EventPhaseStart},
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(self) and player.phase > 2 and player.phase < 7
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    local state = RUtil.getSwitchState(player, self.name)
    if state == 1 then
      if #player:getCardIds("he") > 2 and table.find(room:getOtherPlayers(player), function (p)
        return player:canUseTo(Fk:cloneCard("slash"), p, {bypass_times = true})
      end) then
        if player:getMark("@rfenghou__zhengjiong") > 0 and
          #table.filter(player:getCardIds("h"), function (id) --耦
            return Fk:getCardById(id):getMark("@@rfenghou__zhengjiong-inhand-turn") > 0
          end) < 3 then return end
        local success, dat = room:askForUseActiveSkill(player, "rfenghou__cuoyi_viewas",
          "#rfenghou__cuoyi-slash", false, {bypass_times = true})
        if success and dat then
          RUtil.changeSwitchState(player, self.name)
          local card = Fk:cloneCard("slash")
          card.skillName = self.name
          card:addSubcards(dat.cards)
          room:useCard{
            from = player.id,
            tos = table.map(dat.targets, function(id) return {id} end),
            card = card,
            extraUse = true,
          }
        end
      end
    elseif state == 2 then
      player:drawCards(3, self.name)
      RUtil.changeSwitchState(player, self.name)
    elseif state == 3 and player.phase == Player.Play then
      room:addPlayerMark(player, MarkEnum.SlashResidue.."-phase", 3)
      RUtil.changeSwitchState(player, self.name)
    end
  end,

  on_acquire = function (self, player, is_start)
    RUtil.setSwitchState(player, self.name, 1, 3)
  end,
  on_lose = function (self, player, is_death)
    RUtil.removeSwitchSkill(player, self.name)
  end,
}
local rfenghou__cuoyi_viewas = fk.CreateViewAsSkill{
  name = "rfenghou__cuoyi_viewas",
  card_filter = function(self, to_select, selected)
    if #selected < 3 then
      if Self:getMark("@rfenghou__zhengjiong") == 0 then
        return true
      else
        return Fk:getCardById(to_select):getMark("@@rfenghou__zhengjiong-inhand-turn") > 0
      end
    end
  end,
  view_as = function(self, cards)
    if #cards ~= 3 then return end
    local card = Fk:cloneCard("slash")
    card:addSubcards(cards)
    card.skillName = "rfenghou__cuoyi"
    return card
  end,
}
local zhengjiong = fk.CreateTriggerSkill{
  name = "rfenghou__zhengjiong",
  anim_type = "offensive",
  events = {fk.BeforeTurnStart},
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(self) and player:getMark("@@rfenghou_readying:::"..self.name) == 0 and
      data.reason == "game_rule"
  end,
  on_cost = function(self, event, target, player, data)
    return player.room:askForSkillInvoke(player, self.name, nil, "#rfenghou__zhengjiong-invoke")
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    room:setPlayerMark(player, "@rfenghou__zhengjiong", 3)
    room:sendLog{
      type = "#GainAnExtraTurn",
      from = player.id
    }
    player.tag["_extra_turn_count"] = player.tag["_extra_turn_count"] or {}
    local ex_tag = player.tag["_extra_turn_count"]
    table.insert(ex_tag, self.name)
  end,

  refresh_events = {fk.AfterCardsMove, fk.AfterTurnEnd},
  can_refresh = function(self, event, target, player, data)
    if player:getMark("@rfenghou__zhengjiong") > 0 then
      if event == fk.AfterCardsMove then
        for _, move in ipairs(data) do
          if move.to == player.id and move.toArea == Card.PlayerHand then
            for _, info in ipairs(move.moveInfo) do
              if table.contains(player:getCardIds("h"), info.cardId) then
                return true
              end
            end
          end
        end
      elseif event == fk.AfterTurnEnd then
        return true
      end
    end
  end,
  on_refresh = function(self, event, target, player, data)
    local room = player.room
    if event == fk.AfterCardsMove then
      for _, move in ipairs(data) do
        if move.to == player.id and move.toArea == Card.PlayerHand then
          for _, info in ipairs(move.moveInfo) do
            if table.contains(player:getCardIds("h"), info.cardId) then
              room:setCardMark(Fk:getCardById(info.cardId), "@@rfenghou__zhengjiong-inhand-turn", 1)
            end
          end
        end
      end
    elseif event == fk.AfterTurnEnd then
      room:removePlayerMark(player, "@rfenghou__zhengjiong", 1)
      if player:getMark("@rfenghou__zhengjiong") > 0 then
        player:gainAnExtraTurn(true, self.name)
        if player:getMark("@rfenghou__zhengjiong") == 2 then
          table.remove(player.tag["_extra_turn_count"])
        end
      end
    end
  end,
}
local zhengjiong_prohibit = fk.CreateProhibitSkill{
  name = "#rfenghou__zhengjiong",
  prohibit_use = function(self, from, card)
    if from:getMark("@rfenghou__zhengjiong") > 0 and card then
      if card:isVirtual() then
        if #card.subcards == 0 then
          return false
        else
          return table.find(card.subcards, function (id)
            return Fk:getCardById(id):getMark("@@rfenghou__zhengjiong-inhand-turn") == 0
          end)
        end
      else
        return card:getMark("@@rfenghou__zhengjiong-inhand-turn") == 0
      end
    end
  end,
}
zhengjiong.RfenghouReadySkill = true
Fk:addSkill(rfenghou__cuoyi_viewas)
zhengjiong:addRelatedSkill(zhengjiong_prohibit)
yuantanyuanshangyuanxi:addSkill(cuoyi)
yuantanyuanshangyuanxi:addSkill(zhengjiong)
Fk:loadTranslationTable{
  ["rfenghou__yuantanyuanshangyuanxi"] = "袁谭袁尚袁熙",
  ["#rfenghou__yuantanyuanshangyuanxi"] = "虺蛇自噬",
  ["illustrator:rfenghou__yuantanyuanshangyuanxi"] = "食茸",
  ["designer:rfenghou__yuantanyuanshangyuanxi"] = "熊猫",

  ["rfenghou__cuoyi"] = "厝异",
  [":rfenghou__cuoyi"] = "转换技，锁定技，你除准备阶段和结束阶段以外的阶段开始时：①你需将三张牌当【杀】使用；②摸三张牌；"..
  "③若为出牌阶段，你此阶段使用【杀】次数上限+3。",
  ["rfenghou__zhengjiong"] = "争迥",
  [":rfenghou__zhengjiong"] = "蓄势技，你的额定回合开始前，你可以改为执行三个额外回合，但这些回合中你只能使用本回合获得的牌。",
  ["rfenghou__cuoyi_viewas"] = "厝异",
  ["#rfenghou__cuoyi-slash"] = "厝异：你需将三张牌当【杀】使用",
  ["#rfenghou__zhengjiong-invoke"] = "争迥：是否改为执行三个额外回合？",
  ["@rfenghou__zhengjiong"] = "争迥",
  ["@@rfenghou__zhengjiong-inhand-turn"] = "争迥",
  ["#rfenghou__zhengjiong"] = "争迥",
  ["@@rfenghou_readying:::rfenghou__zhengjiong"] = "争迥失效",
  
  ["$rfenghou__cuoyi1"]="同室操戈，胜者王、败者寇。",
  ["$rfenghou__cuoyi2"]="兄弟无能，吾当继袁氏大统。",
  ["$rfenghou__zhengjiong1"] = "今日吾掌中之剑，必要饮兄弟之血！",
  ["$rfenghou__zhengjiong2"] = "外有强敌环伺，汝二人不欲助我、奈何助贼！",
  ["~rfenghou__yuantanyuanshangyuanxi"] = "冀州宝地，宁予外寇，不予家贼！",
}


local miheng = General:new(extension, "rfenghou__miheng", "qun", 3)

local huaici = fk.CreateTriggerSkill{
  name = "rfenghou__huaici",
  mute = true,
  frequency = Skill.Compulsory,
  events = {fk.RoundStart, fk.RoundEnd, fk.AfterCardUseDeclared},
  can_trigger = function(self, event, target, player, data)
    if player:hasSkill(self) then
      if event == fk.RoundStart then
        return true
      elseif event == fk.RoundEnd then
        return player.room:getBanner("RoundCount") == #player.room.alive_players
      elseif (data.card.type == Card.TypeBasic or data.card:isCommonTrick()) and data.card.suit ~= Card.NoSuit then
        local orig_tar = TargetGroup:getRealTargets(data.tos)
        if table.contains(orig_tar, player.id) then return end
        local suits = {}
        for _, id in ipairs(DIY.GetShownCards(player)) do
          table.insertIfNeed(suits, Fk:getCardById(id).suit)
        end
        -- 自己使用的明置牌能脱手触发
        if (target == player and data.extra_data and data.extra_data.use_shown_cards)
        or table.contains(suits, data.card.suit) then
          local cardSkill = data.card.skill---@type ActiveSkill
          local from = player.room:getPlayerById(data.from)
          return from and not from:isProhibited(player, data.card)
          and cardSkill:modTargetFilter(player.id, {}, from, data.card, false)
        end
      end
    end
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    player:broadcastSkillInvoke(self.name)
    if event == fk.RoundStart then
      room:notifySkillInvoked(player, self.name, "drawcard")
      local cards = room:getNCards(#room.alive_players)
      room:moveCardTo(cards, Card.Processing, nil, fk.ReasonJustMove, self.name, nil, true, player.id)
      if player.dead then return end
      cards = table.filter(cards, function (id) return room:getCardArea(id) == Card.Processing end)
      if #cards == 0 then return end
      cards = room:askForCardsChosen(player, player, 0, #cards, { card_data = { { self.name, cards }  } }, self.name, "#rfenghou__huaici-card")
      if #cards == 0 then return end
      room:obtainCard(player, cards, true, fk.ReasonJustMove, player.id, self.name)
      DIY.ShowCards(player, cards)
    elseif event == fk.RoundEnd then
      room:notifySkillInvoked(player, self.name, "negative")
      room:killPlayer({who = player.id})
    else
      room:doIndicate(data.from, {player.id})
      local anim_type = "negative"
      if data.card.name == "peach" or data.card.name == "ex_nihilo" then
        anim_type = "support"
      end
      room:notifySkillInvoked(player, self.name, anim_type)
      table.insert(data.tos, {player.id})
    end
  end,
}
miheng:addSkill(huaici)
local jianling = fk.CreateTriggerSkill{
  name = "rfenghou__jianling",
  switch_skill_name = "rfenghou__jianling",
  anim_type = "switch",
  frequency = Skill.Compulsory,
  events = {fk.TurnEnd},
  can_trigger = function(self, event, target, player, data)
    if player:hasSkill(self) then
      local success, fail = false, false
      player.room.logic:getEventsOfScope(GameEvent.UseCard, 1, function(e)
        local use = e.data[1]
        if use.from == player.id and use.damageDealt then
          if use.extra_data and use.extra_data.use_shown_cards then
            success = true
          else
            fail = true
            return true
          end
        end
      end, Player.HistoryTurn)
      return not fail and success
    end
  end,
  on_use = function(self, event, target, player, data)
    if player:getSwitchSkillState(self.name, true) == fk.SwitchYang then
      player:gainAnExtraTurn(true, self.name)
    else
      for _, p in ipairs(player.room:getAlivePlayers()) do
        if p:isAlive() and p.faceup then
          p:turnOver()
        end
      end
    end
  end,

  refresh_events = {fk.PreCardUse},
  can_refresh = function (self, event, target, player, data)
    return target == player
  end,
  on_refresh = function (self, event, target, player, data)
    local cards = Card:getIdList(data.card)
    if #cards > 0 and table.every(cards, function (id)
      return table.contains(DIY.GetShownCards(player), id)
    end) then
      data.extra_data = data.extra_data or {}
      data.extra_data.use_shown_cards = true
    end
  end,
}
miheng:addSkill(jianling)
Fk:loadTranslationTable{
  ["rfenghou__miheng"] = "祢衡",
  ["#rfenghou__miheng"] = "顺笼俯仰",
  ["illustrator:rfenghou__miheng"] = "MUMU",
  ["designer:rfenghou__miheng"] = "玄蝶既白",

  ["rfenghou__huaici"] = "怀刺",
  [":rfenghou__huaici"] = "锁定技，每轮开始时，你亮出牌堆顶X张牌，获得其中任意张牌并明置之。你成为与明置牌花色相同的基本牌或普通锦囊牌的额外目标。你于第X轮结束时死亡。（X为场上角色数）",
  ["#rfenghou__huaici-card"] = "怀刺：选择其中任意张获得并明置",

  -- 一名角色回合结束时，若你本回合使用的造成伤害的牌均为明置牌
  ["rfenghou__jianling"] = "翦翎",
  [":rfenghou__jianling"] = " 转换技，锁定技，你仅使用过明置牌造成伤害的回合结束后，阳：你执行一个额外的回合；阴：令所有角色翻至背面。",
}

local yuanshao = General:new(extension, "rfenghou__yuanshao", "qun", 4)

local zongshi = fk.CreateViewAsSkill{
  name = "rfenghou__zongshi",
  anim_type = "offensive",
  prompt = "#rfenghou__zongshi",
  pattern = "archery_attack",
  handly_pile = true,
  card_filter = function(self, to_select, selected)
    return true
  end,
  view_as = function(self, cards)
    if #cards <= 0 or table.contains(Self:getTableMark("@rfenghou__zongshi1-turn"), #cards) 
    or not table.find(cards, function(id) return not table.contains(Self:getTableMark("@[suits]rfenghou__zongshi2-turn"), Fk:getCardById(id).suit) end) then return end
    local c = Fk:cloneCard("archery_attack")
    c.skillName = self.name
    c:addSubcards(cards)
    return c
  end,
  before_use = function (self, player, use)
    player.room:addTableMark(player, "@rfenghou__zongshi1-turn", #use.card.subcards)
    for _, id in ipairs (use.card.subcards) do
      if not table.contains(player:getTableMark("@[suits]rfenghou__zongshi2-turn"), Fk:getCardById(id).suit) then
        player.room:addTableMark(player, "@[suits]rfenghou__zongshi2-turn", Fk:getCardById(id).suit)
      end
    end
  end,
  enabled_at_play = function(self, player)
    return not player:isNude()
  end,
  enabled_at_response = Util.FalseFunc,
}
yuanshao:addSkill(zongshi)

local jiaowang = fk.CreateTriggerSkill{
  name = "rfenghou__jiaowang",
  anim_type = "control",
  frequency = Skill.Compulsory,
  events = {fk.CardUsing},
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(self) and (data.card.type == Card.TypeBasic or data.card:isCommonTrick()) and 
      TargetGroup:getRealTargets(data.tos) and type(data.tos) == "table" and 
      (table.find(TargetGroup:getRealTargets(data.tos), function(p) return player.room:getPlayerById(p).kingdom ~= "qun" end) or 
      (not data.card:isVirtual() and data.card:getMark("@@rfenghou__jiaowang") ~= 0) or 
      (data.card:isVirtual() and #data.card.subcards > 0 and table.find(data.card.subcards, function(id) return
      Fk:getCardById(id):getMark("@@rfenghou__jiaowang") ~= 0 end)))
  end,
  on_use = function(self, event, target, player, data)
    if TargetGroup:getRealTargets(data.tos) and type(data.tos) == "table" then
      local x = 0
      if table.find(TargetGroup:getRealTargets(data.tos), function(id) return player.room:getPlayerById(id).kingdom ~= "qun" end) then
        x = x + 1
      end
      if not data.card:isVirtual() and data.card:getMark("@@rfenghou__jiaowang") ~= 0 then
        x = x + 1
      elseif data.card:isVirtual() and #data.card.subcards > 0 and table.find(data.card.subcards, function(id) return
      Fk:getCardById(id):getMark("@@rfenghou__jiaowang") ~= 0 end) then
        x = x + 1
      end
      data.additionalEffect = (data.additionalEffect or 0) + x
    end
  end,

  refresh_events = {fk.GameStart},
  can_refresh = function (self, event, target, player, data)
    return player:hasSkill(self, true) and not player:isKongcheng()
  end,
  on_refresh = function (self, event, target, player, data)
    local cards = player:getCardIds(Player.Hand)
    for _, id in ipairs(cards) do
      player.room:setCardMark(Fk:getCardById(id), "@@rfenghou__jiaowang", 1)
    end
  end,
}
local jiaowang_maxcards = fk.CreateMaxCardsSkill{
  name = "#rfenghou__jiaowang_maxcards",
  exclude_from = function(self, player, card)
    return card and card:getMark("@@rfenghou__jiaowang") ~= 0 and player:hasSkill("rfenghou__jiaowang")
  end,
}

jiaowang:addRelatedSkill(jiaowang_maxcards)
yuanshao:addSkill(jiaowang)

Fk:loadTranslationTable{
  ["rfenghou__yuanshao"] = "乐袁绍",
  ["#rfenghou__yuanshao"] = "",
  ["illustrator:rfenghou__yuanshao"] = "西国红云",
  ["designer:rfenghou__yuanshao"] = "云佩鸣霄",

  ["rfenghou__zongshi"] = "纵势",
  [":rfenghou__zongshi"] = "出牌阶段，你可以将任意张牌当【万箭齐发】使用，但须满足：1.包含本回合首次转化的花色；2.转化牌数量为本回合首次。",

  ["@rfenghou__zongshi1-turn"] = "纵势",
  ["@[suits]rfenghou__zongshi2-turn"] = "纵势",
  ["#rfenghou__zongshi"] = "纵势：将任意张牌当【万箭齐发】使用，花色须含本回合首次转化的，数量须与本回合转化过的数量均不同。",

  ["rfenghou__jiaowang"] = "骄妄",
  [":rfenghou__jiaowang"] = "锁定技，你的起始手牌标记为“大嘴”且不计入手牌上限。你使用基本牌或普通锦囊牌时，每满足一项便多结算一次：1.指定非群势力角色为目标；2.实体牌含有“大嘴”。",

  ["@@rfenghou__jiaowang"] = "大嘴",

  ["$rfenghou__zongshi1"] = "四世三公之家，当为天下之望。",
  ["$rfenghou__zongshi2"] = "大势在我，可怀问鼎之心。",
  ["$rfenghou__jiaowang1"] = "剑顾四野，马踏青山，今谁堪敌手？",
  ["$rfenghou__jiaowang2"] = "并土四州，带甲百万，吾可居大否？",
  ["~rfenghou__yuanshao"] = "骄兵必败，奈何不记前辙。",
}

return extension
